const baseUrl = 'http://localhost:8082'
export const myRequest = (option) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + option.url,
			data: option.data || {},
			method: option.method || 'GET',
			success: (res) => {
				if(res.data.status !== 0){
					return uni.showToast({
						title: '数据获取失败'
					})
				}
				resolve(res)
			},
			fail: (err) => {
				return uni.showToast({
					title: '请求接口失败'
				})
				reject(err)
			}
		})
	})
}